#!/usr/bin/python
'''
/*
 * This computer program is the confidential information and proprietary trade
 * secret of VistaraIT LLC.  Possessions and use of this program must  conform
 * strictly to the license agreement between the user and VistaraIT LLC.,  and
 * receipt or possession does not convey any rights to divulge, reproduce,  or
 * allow others to use this program without specific written authorization  of
 * VistaraIT LLC.
 * 
 * Copyright (c) 2014 VistaraIT, Inc. All rights reserved.
 */
'''

class PXEManager(object):

    def __init__(self):
        pass
    
    def getIpSubnet(self, ipaddress, netmask):
        try:
            subnetIP = ''
            ip_arr = ipaddress.split(".")
            nm_arr = netmask.split(".")
            subnet = []
            for i in range(0, len(ip_arr)):
                subnet.append(int(ip_arr[i]) & int(nm_arr[i]))
            subnetIP = "." . join(str(i) for i in subnet)
            return subnetIP
        except:
            return ""
